package cn.wolfcode.trip.base.mapper;

import cn.wolfcode.trip.base.domain.Strategy;
import cn.wolfcode.trip.base.query.QueryObject;
import cn.wolfcode.trip.base.query.SearchQueryObject;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface StrategyMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Strategy record);

    Strategy selectByPrimaryKey(Long id);

    List<Strategy> selectAll(QueryObject qo);

    int updateByPrimaryKey(Strategy record);

    List<Strategy> selectForList(QueryObject qo);

    int getBystrategyId(@Param("userId") Long userId, @Param("strategyId") Long strategyId);

    void addCollection(@Param("userId") Long userId, @Param("strategyId") Long strategyId);

    void deleteCollection(@Param("userId") Long userId, @Param("strategyId") Long strategyId);

    List<Strategy> queryForList(SearchQueryObject qo);

    int queryForCount(SearchQueryObject qo);

    int CountForCollection(Long strategyId);//通过攻略id查询收藏数

    void updateBrowseNumById(Long strategyId);

    int queryLikeCountByStrategyId(Long id);

    int queryIsLike(@Param("userId") Long userId, @Param("strategyId") Long strategyId);
}